<?php
namespace Common\Model;
use Think\Model;
class FundingModel extends Model {
    /**
     * model的中文名称
     */
    public $modelName = '筹单';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-group';

    
    protected $_auto = [
        ["lose_time", "strtotime", 3, "function"],
        ["create_time", "strtotime", 3, "function"],
        ["update_time", "strtotime", 3, "function"],
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["user_id", "require", "发起人必须填写!"],
        ["funding_type", "require", "筹单类型必须填写!"],
        ["transaction_type", "require", "交易类型必须填写!"],
        ["already_num", "require", "已筹人数必须填写!"],
        ["total_num", "require", "总人数必须填写!"],
        ["customized_price", "require", "定制价格必须填写!"],
        ["funding_price", "require", "众筹价格必须填写!"],
        ["consignment_price", "require", "代卖佣金必须填写!"],
        ["is_budget", "require", "是否优惠必须填写!"],
        ["is_consignment", "require", "是否代卖必须填写!"],
        ["is_togethor", "require", "是否合单必须填写!"],
        ["is_allow_funding", "require", "是否允许用户众筹必须填写!"],
        ["state", "require", "状态必须填写!"],
        ["lose_time", "require", "失效时间必须填写!"],
        ["name", "require", "名称必须填写!"],
        ["img", "require", "图片必须填写!"],
        ["detail_wap", "require", "wap详情必须填写!"],
        ["detail_pc", "require", "pc详情必须填写!"],
        ["h5_link", "require", "H5必须填写!"],
        ["create_time", "require", "创建时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];
    public $excel = false;
    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "list"=>true,
            "search"=>true,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "user_id"=>[
            "type"=>"foreign",
            "name"=>"发起人",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "funding_type"=>[
            "type"=>"foreign",
            "name"=>"筹单类型",
            "list"=>true,
            "search"=>true,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"funding_type,id,long_name,select",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "transaction_type"=>[
            "type"=>"select",
            "name"=>"交易类型",
            "list"=>true,
            "search"=>true,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"发起,购买,定制",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "already_num"=>[
            "type"=>"input",
            "name"=>"已筹人数",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "total_num"=>[
            "type"=>"input",
            "name"=>"总人数",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "customized_price"=>[
            "type"=>"input",
            "name"=>"定制价格",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "funding_price"=>[
            "type"=>"input",
            "name"=>"众筹价格",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "consignment_price"=>[
            "type"=>"input",
            "name"=>"代卖佣金",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_budget"=>[
            "type"=>"select",
            "name"=>"是否优惠",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"是,否",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_consignment"=>[
            "type"=>"select",
            "name"=>"是否代卖",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"是,否",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_togethor"=>[
            "type"=>"select",
            "name"=>"是否合单",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"是,否",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_allow_funding"=>[
            "type"=>"select",
            "name"=>"是否允许用户众筹",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"是,否",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "state"=>[
            "type"=>"select",
            "name"=>"状态",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"待审核,待支付,待成功,待评价,已完成",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "lose_time"=>[
            "type"=>"datetime",
            "name"=>"失效时间",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "name"=>[
            "type"=>"input",
            "name"=>"名称",
            "list"=>true,
            "search"=>true,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "img"=>[
            "type"=>"file",
            "name"=>"图片",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>false,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "detail_wap"=>[
            "type"=>"ueditor",
            "name"=>"wap详情",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "detail_pc"=>[
            "type"=>"ueditor",
            "name"=>"pc详情",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "h5_link"=>[
            "type"=>"input",
            "name"=>"H5",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>false,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"创建时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
    ];
}